/*
 *  $Id: DragonFireBreath.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

using System.Collections.Generic;

namespace Ragima.Cards001.Fire.Abilities {
    public class DragonFireBreath: AbilityCard {
        public DragonFireBreath(): base("001_f_a_vdragon_breath") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Fire;
            AddManaCost(ElementType.Fire, 2);
        }

        public override void DoAction(TargetArgs args) {
            Creature dragon = args.Caster as Creature;
            if (dragon == null) return;
            IEnumerable<Creature> victims = (args.Player.State == PlayerState.Offence) ? args.Player.Enemy.GetCreatures() : args.Player.Enemy.GetAttackers();
            foreach (Creature enemy in victims) if (dragon.DistanceTo(enemy) <= 1) {
                enemy.DamageBy(NewDamage(args, 3));
                enemy.AddAffect(new Affects.Scorch(1));
            }
        }
    }
}
